<?php
namespace application\system\database\auth\table;
/**
 * Description of Role Hierarchy
 *
 * @author FARFLK
 */
class RoleHierarchy extends \simbola\core\application\dbobj\AppDbTable{
    
    public function init() {
        $this->setModule('system');
        $this->setLu("auth");
        $this->setName("role_hierarchy");
    }
    
    public function setup() { 
        //r0
        $this->addTable();
        //r1        
        $this->addColumns(array(
            'parent_role_title varchar(100)',
            'child_role_title varchar(100)'
        ));
        $this->addPrimaryKey(array('parent_role_title', 'child_role_title'));
        $this->addForeignKeys(array(
            'fkey_RoleHierarchy_parent' => array('parent_role_title', 'system', 'auth', 'role', 'title'),
        ));
        $this->addForeignKeys(array(
            'fkey_RoleHierarchy_child' => array('child_role_title', 'system', 'auth', 'role', 'title'),
        ));
    }
}
